﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using Dapper;

namespace LambdaProj
{
    public class DataService
    {
        public static void RunPooc()
        {
            string connStr = ConfigurationManager.ConnectionStrings["Travelling"].ConnectionString;
            using (SqlConnection conn = new SqlConnection(connStr))
            {
                conn.Open();
                var p = new DynamicParameters();
                p.Add("@hotelcityid",1);
                p.Add("@hotelname", "北京新大都饭店");
                p.Add("@pagenumber",1);
                p.Add("@pagesize", 1);
                p.Add("@hotellevel", 10);
                p.Add("@orderbyfield","info.HotelId");
                p.Add("@ordertype",1);
                p.Add("@totalcount", dbType: DbType.Int32, direction: ParameterDirection.Output);
                var rt = conn.Query("sp_hotelquery", p, commandType: CommandType.StoredProcedure);
                int count = p.Get<int>("@totalcount");
                conn.Close();

            }
        }
    }
}
